Skip to content

fix(cloud-connection): install-local answers an artifact the resolver refuses with its 422 at the declared-rename step, not a 503 - #34573

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-34432-install-local-resolver-refusal
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-34432-install-local-resolver-refusal

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34432

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:install-local 的「声明式重命名」步骤(2c″)遇到解析器拒收的组合包(packages 不是数组、或某个包条目带已退役的 indexes[].unique: true)时,改为回答解析器自己的 422 与错误码,不再回答 503「数据库不可用、请重试」。
  • 为什么改:包作者拿到的是错误归因,重试永远不会成功;同一份字节在 isolated 姿态的 2b 步骤已经回答 422,两个步骤口径不一致。
  • 风险与回滚:只改 @objectstack/cloud-connection 一个文件的拒收答复,不写入任何数据;真正读不到表时仍回 503;未声明状态的异常(如包之间的依赖环)原样抛出。回滚即还原本 PR。
  • 先看:packages/cloud-connection/src/marketplace-install-local-plugin.ts 的 evaluateDeclaredRenames 开头新增的预解析块,以及抽出的 declaredRefusalAnswer(2b 与 2c″ 共用);再看新测试 marketplace-install-local-resolver-refusal-34432.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-resolver-refusal-34432.test.ts,预期 5 个用例全绿(两条 422、一条 503 对照、一条 200 对照、一条依赖环原样抛出)。
  • 需要你做的:无,席位落地。

What changes

Step 2c″ of POST /api/v1/marketplace/install-local (evaluateDeclaredRenames) caught every throw out of planDeclaredRenames and answered it 503 SERVICE_UNAVAILABLE "… could not be read … Retry once the database answers". That included the artifact resolver's declared 422 refusal of a composed body. The step now:

  • resolves the bodies the plan reads before any table is read, through the plan's own fold (packageUpgradeSideOf: the resolveStackCollection reads of objects, objectExtensions and data; the installed body too on a re-install);
  • answers a refusal there with that refusal's own declared status and code (422 INVALID_ARTIFACT_PACKAGES / INVALID_ARTIFACT_PACKAGE_ENTRY) and writes nothing;
  • rethrows an undeclared throw out of the resolver (its dependency-cycle error, a bare Error), and does not relabel it;
  • keeps the 503 for a throw out of the plan itself, which is now only the table read.

The reader is the one step 2b (#34428) answers the same refusal with. It is extracted within the file as declaredRefusalAnswer(manifestId, err), so the two steps share one implementation and answer the same bytes with the same status, code and sentence. Step 2b's behaviour is byte-identical: same predicate (declaredStatus === undefined || status >= 500 ⇒ rethrow), same body, same status.

Changeset: @objectstack/cloud-connection patch.

Tests

New file packages/cloud-connection/src/marketplace-install-local-resolver-refusal-34432.test.ts. It drives the real install route handler, under the single posture, with the route-handler harness that #34428 used (runtime mocked without the step-1c collectors):

  • packages: 'not-a-list' ⇒ 422, error.code INVALID_ARTIFACT_PACKAGES. Nothing is registered, there is no ledger entry, and the driver is never asked to read a table.
  • A package entry with a retired bare indexes[].unique: true ⇒ 422, INVALID_ARTIFACT_PACKAGE_ENTRY. Nothing is written.
  • CONTROL: a well-formed composed artifact whose renamed field's table read throws ⇒ 503 SERVICE_UNAVAILABLE, and nothing is written.
  • CONTROL: the same artifact over a readable table ⇒ 200.
  • A dependency cycle between two packages (an undeclared resolver throw) ⇒ rethrown out of the handler, not answered 503.

No existing test was changed.

Ablation (fix removed ⇒ red), via scripts/ablation-replace.mjs

Mutation: packageUpgradeSideOf(converted); ⇒ /* ABLATION-34432 */ in marketplace-install-local-plugin.ts, at commit e6e6b07. The anchor count went 1 ⇒ 0 and the blob went 8302cb31cf1b ⇒ 07061200e185. The test imports the plugin by relative path (source, not dist/), so no rebuild sits in the loop.

  • Tests 3 failed | 2 passed (5): both 422 pins received 503 SERVICE_UNAVAILABLE with the card's exact sentence ("the tables its declared rename(s) carry could not be read (A release artifact's packages must be an array …) … Retry once the database answers."). The cycle pin received the 503 answer ("… could not be read ([Kernel] Circular dependency detected: com.example.suite.core) …") and no throw.
  • Both controls stayed green.
  • Restore: blob after restore 8302cb31cf1b == blob at HEAD, and git diff HEAD is empty.
Package suite and typecheck at the final head

After the closure rebuild (pnpm --filter '@objectstack/cloud-connection...' build) at 18b6049:

  • pnpm --filter @objectstack/cloud-connection typecheck: exit 0. tsconfig.test.json --listFiles includes the new test file.
  • pnpm --filter @objectstack/cloud-connection exec vitest run --maxWorkers=2: Test Files 89 passed (89), Tests 1295 passed (1295).
  • Lock: VERDICT command-exit 0.

Acceptance notes

  • Where this step is reached first. The harness mocks @objectstack/runtime without collectJobsWithoutBody / collectHooksWithoutBody. That stands for a runtime that predates the step-1c code judgements, and on such a runtime 2c″ is the first step to resolve the packages. With the real runtime the same two bodies are resolved first at step 1c (unrunnableCode ⇒ collectBundleJobs ⇒ resolveArtifactCollections), and the resolver's refusal leaves the handler as a throw. I measured this by running the same pins once over the real runtime: the throw comes out of handleInstall at the collectJobs(manifest) call. The Hono transport's error seam (declaredEnvelopeForThrow) then answers it 422 with the resolver's code and reports a transport escape. That last part is read from plugin-hono-server/src/adapter.ts, not measured. So on a current runtime the client already saw the 422, and this PR changes the 2c″ answer for the older-runtime composition. Step 1c answering the refusal itself, as 2b and now 2c″ do, is outside this card.
  • What the 503 still covers. A throw out of planDeclaredRenames after the bodies resolved is answered as the table read. That is the driver's introspection, plus any fault of the plan's own code, which this step has always answered 503. Telling those two apart needs a marker at the driver call inside marketplace-install-declared-renames.ts, which is outside this card's file surface.
  • Read superset. On a fresh install the pre-resolution also reads data, which the plan alone does not read. A composed body the resolver refuses only through data is now refused here, before any write. Before, the manifest service refused it at register, on the same bytes.
  • A dependency cycle between packages of one artifact is a bare Error by resolveArtifactPackageOrder's documented contract (artifact-collections.ts header). It is rethrown here and, by the transport seam, answered 500 INTERNAL_ERROR with no cause. Filed: install-local: a composed artifact with a package dependency cycle answers an opaque 500 instead of naming the cycle #34574.
  • On a re-install the pre-resolution also folds the installed copy (packageUpgradeSideOf(installed)). When today's resolver refuses that stored copy, the answer is a 422 that names the incoming package ("Package 'X' cannot be installed"), and that side has no pin of its own. Before this PR the same case answered 503, and step 2c′ folds the installed copy again unguarded, so this is no new dead end, only a misattributed message. Filed: install-local reinstall: a refused installed copy is reported as "Package 'X' cannot be installed", blaming the incoming package #34583.

Verification

Gates were run after the last commit, one at a time, each with stdin closed. The derived list is node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 18b6049 (3 paths, 71 commands). Reconciliation is --ran with Run reconciliation — 71 derived, 71 run, 0 NOT-MEASURED, 0 UNRUN..

Gate results

All 71 exit 0. check:dual-build-cjs-loads first answered exit 3 (PREREQUISITE NOT MET, no dist/) and was re-run green after a whole-workspace build (turbo run build --filter=!@objectstack/docs --concurrency=2, lock VERDICT command-exit 0): 124 published require entry point(s) across 72 package(s) load.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:durability-log-level :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:init-service-contract :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:route-envelope :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:startup-registry-verdict :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

…fact resolver refuses with that refusal, not the unread-table 503

Claude-Session: https://claude.ai/code/session_01ADHkmRXuRn93HphKp7kXEz
Co-authored-by: Claude <noreply@anthropic.com>
…olver refusal; name the runtime the pins run over

Claude-Session: https://claude.ai/code/session_01ADHkmRXuRn93HphKp7kXEz
Co-authored-by: Claude <noreply@anthropic.com>
…the rename plan once the bodies resolved

Claude-Session: https://claude.ai/code/session_01ADHkmRXuRn93HphKp7kXEz
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cloud-connection, touching 4 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/cli.mdx (via MarketplaceInstallLocalPlugin (symbol, a top-level class))
What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 7 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 370e21ad47acc78d567d7f070cfe02e7e7647452 — the merge of head 18b604942f7eb7d7c6c297ec09078a94d1f6325a into base 1e4656d01fe485935c493a00ecdb8e0f8a0fed55, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 370e21ad47acc78d567d7f070cfe02e7e7647452 && git checkout 370e21ad47acc78d567d7f070cfe02e7e7647452
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 18b604942f7eb7d7c6c297ec09078a94d1f6325a && git checkout -B drift-repro 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 && git merge --no-ff 18b604942f7eb7d7c6c297ec09078a94d1f6325a

node scripts/docs-audit/affected-docs.mjs --json 1e4656d01fe485935c493a00ecdb8e0f8a0fed55

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Final head for review: 18b604942f7eb7d7c6c297ec09078a94d1f6325a (card #34432, branch claude/issue-34432-install-local-resolver-refusal). CI on this head: 37 success, 18 skipped, 0 failed. Clause-②: no, Metadata-protocol: none, no contract path: no contract-tier review is owed. Owed: L1 first review. Body carries the filed follow-up #34574. A push after this comment restarts the review on the new head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPZf3MhxKeGaxV4P3W

席位核对

L1 first review · ACCEPT · head 18b604942f7eb7d7c6c297ec09078a94d1f6325a · card #34432 · read 2026-11-17T02:13Z

Checklist (read on GitHub at this head, not from the report)

  • Shape: draft, base main, the attribution comment and "Requested by" line open the body, then Fixes #34432. Closing-keyword scan of the whole body: one hit, #34432; #34428, #34407, #34574 carry no keyword. Fixes is right: the card's three Target boxes (declared status and code, undeclared throw rethrown, route pins with a real 503 control) are all in the diff.
  • Head provenance: 18b60494 = d05e8d13 + a merge of main; all 3 PR files have the same blob at both commits.
  • File surface: 3 files from get_files, exactly claim 6934080915: marketplace-install-local-plugin.ts (evaluateDeclaredRenames and the 2b reader, shared), one card-named test file, the changeset.
  • Declarations: Clause-②: no, Metadata-protocol: none in the body and the changeset. Both hold: the input is refused before and after, only the status and code of the answer change, and no authorable key moves.
  • Mechanism, read in the source:
    • declaredRefusalAnswer is the 2b catch body moved out unchanged: the same predicate (declaredStatus === undefined || status >= 500 ⇒ undefined ⇒ rethrow), the same code, the same sentence. 2b now calls it, so its answer is byte-identical.
    • evaluateDeclaredRenames runs packageUpgradeSideOf(converted), and packageUpgradeSideOf(installed) when there is an installed side, before planDeclaredRenames. Those are the same fold calls the plan makes (marketplace-install-rename-planner.ts:81), so a body the resolver refuses never reaches the plan's catch, and the 503 below is left with the table read and the plan's own faults (the body says so).
    • The caller at :3248 passes refusal.status through; widening the return type from 422 | 503 to number is the only signature move.
  • Changeset: .changeset/34432-install-local-resolver-refusal.md, @objectstack/cloud-connection patch (published). Sentences checked: "resolves the bodies before it reads any table" (the pre-fold sits before planDeclaredRenames); "422 INVALID_ARTIFACT_PACKAGES or INVALID_ARTIFACT_PACKAGE_ENTRY, with the resolver's sentence. Nothing is written" (pinned); "the answer the isolated-posture unique-scope gate already gives … through the same reader" (shared function); "a dependency cycle … is rethrown" (pinned); "A runtime that carries them resolves the packages earlier, so its answer does not change" (step 1c: collectJobsWithoutBody / collectHooksWithoutBody are optional and feature-tested at :7139–:7146, so the older-runtime path is a coded path, not a test artefact).
  • Rejection assertions: both 422 pins assert status and error.code, and nothing written (no register, no ledger entry, the driver's planDeclaredRenames and carryDeclaredRenames never called). The 503 control asserts status and SERVICE_UNAVAILABLE, and that the driver was asked once.
  • Controls and ablation: a 503 control on an unreadable table, a 200 control on a readable one, and the cycle pin. The ablation removes packageUpgradeSideOf(converted): both 422 pins and the cycle pin go red with the card's 503 sentence, both controls stay green, and the blob is restored to HEAD's.
  • Deviations, accepted as reported:
    • Reach: on a current runtime step 1c resolves first, and the refusal leaves the handler as a throw that the Hono seam answers 422. That was measured to the throw and read from adapter.ts for the 422. The changeset does not claim the transport's answer.
    • Read superset: a fresh install now also folds data, so a body refused only through data is refused here before any write instead of at register, on the same bytes and with the same code.
  • Gates at this head: check-runs on 18b60494…: 55 runs, 37 success, 18 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Type Check · workspace, Dogfood Regression Gate, Check Changeset and Test Core 1–8 success. Derived-gate round 71/71. Final head announced in 6935802086.

Out of scope, for the area to place (one line each: filed #N or dropped — reason)

  • The installed-side arm (packageUpgradeSideOf(installed) in the new pre-fold) has no pin and no ablation. A refusal there names the stored copy's fault but reads "Package 'X' cannot be installed", as if the incoming bytes were at fault. Before this PR the same case answered 503 at 2c″, and 2c′ folds the installed side again without a guard, so this PR adds no new dead end. Reachable only if a body the resolver accepted at install is refused now, for example by a shape retired since and not converted forward.
  • The cycle's opaque 500 is already filed #34574.

Owed after this

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Landing 18b604942f7eb7d7c6c297ec09078a94d1f6325a (card #34432) on L1 ACCEPT 6935847976 at this head. No L2 owed (Clause-②: no, no contract path).

probe reading
check-governed-merges.mjs --pr 34573 NOT governed; 326 changed lines ≤ 3000
git merge-tree --write-tree of this head against origin/main b01904833 exit 0; main is 14 first-parent commits past the merge base

Dispositions asked by the L1 review: the installed-copy side of the pre-resolution (misattributed refusal message, no pin) is filed: #34583; the dependency-cycle 500 is filed: #34574. Both are in the body's Acceptance notes. State: ready, auto-merge armed.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 02:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit c5fd012 Nov 17, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34432-install-local-resolver-refusal branch November 17, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install-local: an artifact the resolver refuses answers 503 "retry once the database answers" instead of the resolver's 422

2 participants